extends ./index.jade

block content
	.rightSide
		.container-fluid
			.row
				form#orderForm.form.form-inline
					.form-group
						label 学校
							select#querySchool.form-control(name="schools")
					.form-group
						label.marginLeft 状态
						select#status.widthFixed
							option(value = '-1') 全部
							option(value = '0') 没有创建支付交易
							option(value = '1') 等待买家付款
							option(value = '2') 等待成团
							option(value = '3') 买家已付款
							option(value = '4') 等待买家确认收货
							option(value = '5') 买家已签收
							option(value = '6') 付款后用户退款成功，交易自动关闭
							option(value = '7') 用户关闭交易
							option(value = '8') 所有关闭订单
					.form-group
						label.marginLeft 下单时间
						input#orderdateStart.datepicker.date.form_datetime.controls.order_date.widthFixed(type='text' placeholder='请选择开始时间' required)
						input#timeStart.datepicker.date.form_datetime.controls.order_time.widthFixed(type='text' placeholder='请选择开始时间' required)
						labe 至
						input#orderdateEnd.datepicker.date.form_datetime.controls.order_date.widthFixed(type='text' placeholder='请选择结束时间' required)
						input#timeEnd.datepicker.date.form_datetime.controls.order_time.widthFixed(type='text' placeholder='请选择结束时间' required)
					.form-group
						input#queryOrder.btn.btn-primary.marginLeft(type='submit' value='查询')
					.form-group
						#tips.text-danger
			#order_info.row(display='none')
				.row
					table.table.table-bordered.table-hover.center
						thead
							tr.active
								th 商品
								th 单价（元）
								th 数量
								th 买家
								th 下单时间
								th 状态
								th 金额
								th 留言
						tbody#order
				.row.text-right.forcedVerticalCenter
					span 
						|共
						span#total
						|条记录
					#paginator.paginator
				
	link(rel='stylesheet' href='/css/lib/bootstrap-datetimepicker.css')
	link(rel='stylesheet' href='/css/lib/select2.min.css')
	script#template_school(type='text/dot-tpl')
		|{{~it:value:index}}
		option(value='{{=value.id}}') {{=value.name}}
		|{{~}}
	script#template_order(type="text/dot-tpl")
		|{{~it:value:index}}	
		|{{for(var item in value.tradeItems){}}
		|{{?item==0}}
		tr
			td {{=value.tradeItems[item].item_name}}
			td {{=value.tradeItems[item].trade_price}}
			td {{=value.tradeItems[item].quantity}}
			td(rowspan='{{=value.tradeItems.length}}') {{=value.receiver_address}}
			td(rowspan='{{=value.tradeItems.length}}') {{=value.created_time}}
			td(rowspan='{{=value.tradeItems.length}}') {{=value.status}}
			td(rowspan='{{=value.tradeItems.length}}') {{=value.price}}
			td(rowspan='{{=value.tradeItems.length}}') {{=value.trade_comment}}
		|{{??}}
		tr
			td {{=value.tradeItems[item].item_name}}
			td {{=value.tradeItems[item].trade_price}}
			td {{=value.tradeItems[item].quantity}}
		|{{?}}
		|{{}}}
		|{{~}}
	script(src='/js/lib/require.js' data-main='/js/order_query')
